
<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>Document</title>
  <script>
    window.onload = function(){
      var arr = new Array();     
      for(var i =0;i< 3;i++){
        arr[i] = i * i;
      }
      arr.push(100);
      arr.unshift(101);
      
      // for(var i =0;i<arr.length;i++){
      //   console.log(arr[i]);
      // }
      // for (var a of arr) {
      //   console.log(a);
      // }
      // for(var i in arr){
      //   console.log(arr[i]);
      // }
      console.log(arr);
      arr.pop();
      console.log(arr);
      arr.shift();
      console.log(arr);

      var b = [1,2,3,4,5];
      var c = arr.concat(b)
      console.log(c);

      
      // c.splice(2,4);
      // console.log(c);
      
      console.log(c.slice(2,4));

    }
  </script>
</head>
<body>
  
</body>
</html>